//! Copyright 2012 NTH Technology, Inc.
//! All rights reserved
//!
#ifndef __SysTick_h__
#define __SysTick_h__

#include "BasicTypes.h"

extern "C" {
    extern volatile U32 s_TickCnt;
    extern void SysTick_Handler(void);
}

class cSysTick
{
private:
    U32 mTimeBase;
    U32 mTimeout;

public:
    static void InitReset();

    inline void ResetTimeBase()
    {
        mTimeBase = s_TickCnt;
    }

    inline void SetTimeout(U32 iTimeout)
    {
        mTimeout = iTimeout;
    }

    bool CheckTimeOut();
};

#endif // __SysTick_h__
